//
//  BLUserViewController.swift
//  BLLiveTelecast
//
//  Created by BigL055 on 16/5/20.
//  Copyright © 2016年 bigL.liveTelecast.com. All rights reserved.
//

import UIKit

class BLUserViewController: UITableViewController {
    
    var titles = [String]()
    var classNames = [String]()
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        addCell("调试选项", className: String(BLDebugViewController))
        tableView.reloadData()
    }
    
    
    func addCell(title : String,
                 className : String) {
        
        titles.append(title)
        classNames.append(className)
    }
    
    
    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return titles.count
    }
    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        var cell = tableView.dequeueReusableCellWithIdentifier("userViewCellID")
        if cell == nil {
            cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "userViewCellID")
        }
        cell?.textLabel?.text = titles[indexPath.item]
        
        return cell!
    }
    
    
    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        
        var VC : UIViewController
        let navTitle = titles[indexPath.item]
        
        switch indexPath.item {
        case 0:
            let storyBoard = UIStoryboard(name: String(BLDebugViewController), bundle: nil)
             VC = storyBoard.instantiateInitialViewController()!
             VC.navigationItem.title = navTitle
            navigationController?.pushViewController(VC, animated: true)
        default: break
        }
        
        
    }
    
}
